/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Erp_mara",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using MyErp.IServices;
using VOL.Core.Utilities;
using Microsoft.AspNetCore.Authorization;
using MyErp.IRepositories;

namespace MyErp.Controllers
{
    public partial class Erp_maraController
    {
        private readonly IErp_maraService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly IErp_maraRepository _IErp_mararesponsite;
        [ActivatorUtilitiesConstructor]
        public Erp_maraController(
            IErp_maraService service,
            IHttpContextAccessor httpContextAccessor,
            IErp_maraRepository IErp_maraRepository
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
            _IErp_mararesponsite = IErp_maraRepository;
        }

        private WebResponseContent webResponse = new WebResponseContent();
        [HttpPost,Route("PublishPart")]//,AllowAnonymous
        public WebResponseContent PublishPart(System.Guid part_id)
        {
            Erp_mara Erp_mara = new Erp_mara();
            Erp_mara.mara_id = part_id;
            Erp_mara.ppap_s = "待RFQ资料发放&指定SQE";
            _IErp_mararesponsite.Update(Erp_mara, x => new { x.ppap_s }, true);//部分字段更新
            return webResponse.OK("发布成功！");
        }


    }
}
